<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var num = parseInt(prompt("请输入一个五位数", "")); //输入一个整形的五位数
    //依次选取出个十百千万上面的数
    var gewei = num % 10;
    var shiwei = num / 10 % 10;
    var baiwei = num / 100 % 10;
    var qianwei = num / 1000 % 10;
    var wanwei = num / 10000 % 10;
    //判断是否为回文数
    if (parseInt(gewei) == parseInt(wanwei) && parseInt(shiwei) == parseInt(qianwei)) {
        alert("回文数");
    } else {
        alert("不是回文数");
    }
</script>

</html>